package com.tmt.im.common.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.tmt.im.common.annotation._AllowUpdate;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

import java.io.Serial;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/3 16:41
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class WalletPoJo implements IGetKey<Long> {

    @Serial
    private static final long serialVersionUID = -4053075942453369421L;

    public static final String CACHE_NAME = "wallet";

    @QuerySqlField(name = "id", index = true)
    private Long id;

    @QuerySqlField(name = "balance")
    @_AllowUpdate
    private Long balance;

    @QuerySqlField(name = "password")
    @_AllowUpdate
    @JsonIgnore
    private String password;

    @QuerySqlField(name = "ali_pay")
    @_AllowUpdate
    private String aliPay;

    @QuerySqlField(name = "wei_xin")
    @_AllowUpdate
    private String weiXin;

    @QuerySqlField(name = "create_time")
    @_AllowUpdate
    @JsonIgnore
    private Timestamp createTime;

    @QuerySqlField(name = "owner_id")
    @JsonIgnore
    private Long ownerId;

    @QuerySqlField(name = "version")
    @_AllowUpdate
    @JsonIgnore
    private Long version;

    @JsonIgnore
    private boolean insert;

    @Override
    public Long getKey() {
        return id;
    }
}
